/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 */

#if !defined (__PI_LIB_H_INSIDE__) && !defined (PI_LIB_COMPILATION)
#error "Only <pi_lib.h> can be included directly."
#endif

#ifndef __PI_MEM_H__
#define __PI_MEM_H__



#define pi_new(struct_type, count) \
		((struct_type*) pi_malloc (sizeof (struct_type) * count))

#define pi_new0(struct_type, count)	\
		((struct_type*) pi_malloc0 (sizeof (struct_type) * count))


#include "pi_micro.h"
#include "pi_type.h"


PI_BEGIN_DECLS

void*			PI_API pi_malloc(uint size);
void*			PI_API pi_malloc0(uint size);
void*			PI_API pi_realloc(void* p, uint old_size, uint new_size);
void			PI_API pi_free(void* p);

void			PI_API pi_memset(void* p, int val, uint size);
PiCompR			PI_API pi_memcmp(const void* dest, const void* src, uint size);
void			PI_API pi_memcpy(void* dest, const void* src, uint size);
void			PI_API pi_memmove(void* dest, const void* src, uint size);


PI_END_DECLS


#endif /* __PI_MEM_H__ */
